﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CSharpDemo
{
    /// <summary>
    /// 通用类：手机类
    /// </summary>
    public class CellPhone
    {
        /// <summary>
        /// 名字
        /// </summary>
        public string name;
        /// <summary>
        /// 品牌
        /// </summary>
        public string brand;
        /// <summary>
        /// 价格
        /// </summary>
        public float price;

        /// <summary>
        /// 手机系统
        /// </summary>
        public string os;

        /// <summary>
        /// 电池
        /// </summary>
        public DianChi battery;


        public void PowerOn()
        {
            if (battery == null)
            {
                MessageBox.Show("没有电池");
            }
            else if (battery.dianLiang == 0)
            {
                MessageBox.Show("电量不足");
            }
            else
            {
                MessageBox.Show("哦豁买到山寨机了");
            }
        }


        public void 方法名()
        {
            //代码
        }

        public void AboutMe()
        {
            string info = string.Format("手机名称:{0}\r\n", name);
            info += string.Format("手机品牌:{0}\r\n", brand);
            info += string.Format("手机价格:{0}\r\n", price);
            info += string.Format("系统版本:{0}", os);
            MessageBox.Show(info);
        }
    }
}
